package com.yenlien.traceyun.plant.dao;


import com.yenlien.traceyun.plant.entity.FruitUser;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

/**
 * @author jialong
 * @date 2021/12/13
 * @description:
 **/

public interface FruitUserDao extends BaseJpaDao<FruitUser> {


    FruitUser findByUsername(String username);

    @Query(value = "SELECT id FROM fruit_user WHERE username = ?1 AND id <> ?2", nativeQuery = true)
    String checkByUsername(String username, String id);

    @Query(value = "SELECT id FROM fruit_user WHERE username = ?1", nativeQuery = true)
    String checkByUsername(String username);
}
